﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Text;
using SR = SocketHttpLib.SystemSR;
namespace SocketHttpLib
{
    internal class NetRes
    {
        private NetRes()
        {
        }

        public static string GetWebStatusString(string Res, WebExceptionStatus Status)
        {
            //string @string = SR.GetString(WebExceptionMapping.GetWebStatusString(Status));
            string @string = SR.GetString(SR.InvokeStaticNonPublicMethod("System.Net.WebExceptionMapping", "GetWebStatusString",new object[] { Status }) as string);
            string string2 = SR.GetString(Res);
            return string.Format(CultureInfo.CurrentCulture, string2, new object[]
            {
                @string
            });
        }

        public static string GetWebStatusString(WebExceptionStatus Status)
        {
            //return SR.GetString(WebExceptionMapping.GetWebStatusString(Status));
            return SR.GetString(SR.InvokeStaticNonPublicMethod("System.Net.WebExceptionMapping", "GetWebStatusString", new object[] { Status }) as string);
        }

        public static string GetWebStatusCodeString(HttpStatusCode statusCode, string statusDescription)
        {
            string arg_18_0 = "(";
            int num = (int)statusCode;
            string text = arg_18_0 + num.ToString(NumberFormatInfo.InvariantInfo) + ")";
            string text2 = null;
            try
            {
                text2 = SR.GetString("net_httpstatuscode_" + statusCode.ToString(), null);
            }
            catch
            {
            }
            if (text2 != null && text2.Length > 0)
            {
                text = text + " " + text2;
            }
            else if (statusDescription != null && statusDescription.Length > 0)
            {
                text = text + " " + statusDescription;
            }
            return text;
        }

        public static string GetWebStatusCodeString(FtpStatusCode statusCode, string statusDescription)
        {
            string arg_18_0 = "(";
            int num = (int)statusCode;
            string text = arg_18_0 + num.ToString(NumberFormatInfo.InvariantInfo) + ")";
            string text2 = null;
            try
            {
                text2 = SR.GetString("net_ftpstatuscode_" + statusCode.ToString(), null);
            }
            catch
            {
            }
            if (text2 != null && text2.Length > 0)
            {
                text = text + " " + text2;
            }
            else if (statusDescription != null && statusDescription.Length > 0)
            {
                text = text + " " + statusDescription;
            }
            return text;
        }
    }
}
